<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="tb-master.html" />
<head>
	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  	<title></title>
  	${tmpl_context.zeroisp_boxy()}
  	${tmpl_context.googlemaps_js()}
</head>
<body>
<table>
<tbody>
<tr >
	<td style="width:60%" >
		<h4><a href="/toolbox/team/index/${category.category_name}">${category.category_name}</a></h4>
		<div id="post_content">
			<h3>${category.category_label}
			<a onclick="return create('/toolbox/team/edit_page/${category.category_name}', {modal: true});"
						href="">[Edit]</a>
			</h3>
			<blockquote>
				<i py:if="category.category_description">${category.category_description}
				<a onclick="return create('/toolbox/team/edit_page/${category.category_name}', {modal: true});"
						href="">[Edit]</a>
				</i>
				<i py:if="not category.category_description">No description available
					<a onclick="return create('/toolbox/team/edit_page/${category.category_name}', {modal: true});"
						href="">[Add]</a>
				</i>
			</blockquote>
		</div>
		<div id="post_content">
			<div style="width:100%; text-align: right;">
				<a href="/toolbox/team/edit_page_content/${category.category_name}">[Edit]</a>
			</div>
			<div py:if="team.xml_content">
				${XML(team.xml_content)}
			</div>
			<div py:if="not team.xml_content">
				No content available
			</div>
			<div style="width:100%; text-align: right;">
				<a href="/toolbox/team/edit_page_content/${category.category_name}">[Edit]</a>
			</div>
		</div>
		<div>
		<table>
			<tr>
				<td>
					<div id="post_content" class="ui-corner-all">
					<h4>Latest Posts</h4>
						<div py:for="p in team.posts">
						<div>
							<b><a href="/toolbox/post/index/${category.category_name}/${str(p.post_id)}"> ${p.post_title} </a><span><i class="small">( ${p.post_category.category_label} - ${format_date(p.post_date, format='long', locale='it')} )</i></span></b>
						</div>
						<div>
							<i class="quiet">${p.short_description}</i>
						</div>
						</div>
					</div>
				</td>
				<td>
					<div id="post_content" class="ui-corner-all">
					<h4>Categories</h4>
					<p py:for="c in team.categories">${c.category_label}
					<span class="small"> (<i>${c.short_description}</i>) [${len(c.posts)}]</span>
					</p>
					</div>
				</td>
			</tr>
		</table>

		</div>
	</td>
	<td style="width:40%">
		<div id="post_map" class="ui-corner-all" >
			<div style="width:100%; text-align: right;">
				<a href="/toolbox/team/edit_page_address/${category.category_name}">[Edit]</a>
			</div>
			<h4 py:if="team.address">${team.page.post_address.google_address}</h4>
			<h4 py:if="not team.address">No address available</h4>
			<div id="map_canvas" style="width: 400px; height: 320px"></div>
		</div>
	</td>
</tr>
</tbody>
</table>
<!--
	<div py:for="t in user.teams" id="post_content" class="ui-corner-all">
		<h4><a href="/toolbox/team/${t.team_alias}">${t.team_alias}</a></h4>
		<span>${t.member}</span>

	</div>
 -->

<script type="text/javascript">
var allDialogs = [];

function create(href, options) {
options = $.extend({title: "Dialog"}, options || {});
var dialog = new Boxy.load(href, options); /*new Boxy(content, options);*/
allDialogs.push(dialog);
return false;
}
</script>
  	<script py:if="team.address">
	google.load("maps", "2");


	// Call this function when the page has been loaded
	function initialize() {
	  var map_var =  {
		'div':'map_canvas',
		'zoom': 10,
		'lat': ${team.address.google_lat},
		'lng': ${team.address.google_lng},
	  };
	  var map = new google.maps.Map2(document.getElementById(map_var['div']));
	  map.setUIToDefault();
	  var point = new google.maps.LatLng(map_var['lat'], map_var['lng']);
	  map.setCenter(point, map_var['zoom']);
	  map.addOverlay(new google.maps.Marker(point));
	  var Wikipedia = new google.maps.Layer("org.wikipedia.it");
	  map.addOverlay(Wikipedia);
	  var Panoramio = new google.maps.Layer("com.panoramio.all");
	  map.addOverlay(Panoramio);
		}
	google.setOnLoadCallback(initialize);
  	</script>

</body>
</html>
